﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Text;
using AjaxPro;

using Gift.Model;
using Gift.DAL;

namespace WebSite.Code
{
    public class MemberCardInfo_ajax
    {
        readonly BasePage theBase = new BasePage();

        [AjaxMethod]
        public string MemberInfo()
        {

            if (theBase.LoginUserMember != null)
            {
                if (theBase.LoginUserMember.DicUserCardList != null && theBase.LoginUserMember.DicUserCardList.Count > 0)
                {
                    StringBuilder sbInfo = new StringBuilder("您的卡券详情 ");
                    foreach (DB_Card card in theBase.LoginUserMember.DicUserCardList.Values)
                    {

                        sbInfo.AppendFormat("<br/> *卡号:{0},卡名称:{1},卡面值:{2},<a style='cursor:pointer;'  onclick='removeCard({3});'>[删除] &nbsp;</a>"
                                              , card.cardcode
                                              , card.CardTypeName
                                              , card.cardprice.ToString("#,##")
                                              , card.cardid);
                    }
                    sbInfo.Append("&nbsp;<a class=\"thickbox\" href=\"/cn/Exchange.aspx?TB_iframe=true&height=370&width=640\" target=\"_blank\">[继续输入卡券];</a>");
                    return sbInfo.ToString();
                }

            }
            return "";

        }
    }
}